package thinkinjava.c21_concurrency;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Auther DRevelation
 * @Date 2020-05-11 下午 16:26
 * @Desc singleThreadExecutor管理的线程将排队执行
 */
public class SingleThreadExecutor {
    public static void main(String[] args) {
        ExecutorService exec = Executors.newSingleThreadExecutor();
        for (int i = 0; i < 5; i++) {
            exec.submit(new LiftOff());
        }
        exec.shutdown();
    }
}
